<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>简单计数器</title>
    <style>
        body {
            font-family: Arial, sans-serif;
            display: flex;
            justify-content: center;
            align-items: center;
            height: 100vh;
            background-color: #f4f4f9;
        }

        .counter {
            background-color: #fff;
            padding: 20px;
            border-radius: 8px;
            box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
            text-align: center;
        }

        button {
            padding: 10px 20px;
            margin: 5px;
            background-color: #007BFF;
            color: #fff;
            border: none;
            border-radius: 4px;
            cursor: pointer;
        }

        button:hover {
            background-color: #0056b3;
        }

        #count {
            font-size: 24px;
            margin: 20px 0;
        }
    </style>
</head>

<body>
    <div class="counter">
        <h2>简单计数器</h2>
        <p id="count">0</p>
        <button id="increment">增加</button>
        <button id="decrement">减少</button>
        <button id="reset">重置</button>
    </div>
    <script>
        const countElement = document.getElementById('count');
        const incrementButton = document.getElementById('increment');
        const decrementButton = document.getElementById('decrement');
        const resetButton = document.getElementById('reset');

        let count = 0;

        incrementButton.addEventListener('click', function () {
            count++;
            countElement.textContent = count;
        });

        decrementButton.addEventListener('click', function () {
            count--;
            countElement.textContent = count;
        });

        resetButton.addEventListener('click', function () {
            count = 0;
            countElement.textContent = count;
        });
    </script>
</body>

</html>
    